package com.mes.service.cb;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mes.dao.cb.MaterielMapper;
import com.mes.entity.cb.Materiel;
import com.mes.entity.cb.PageBean;

/**
 * @ClassName: MaterieServiceImpl
 * @Description:物料信息
 * @Author cb
 * @Date 2017年12月22日 下午3:46:59
 * @version 1.0
 */
@Service
@Transactional
public class MaterieServiceImpl implements MaterieService{


	@Resource
	private MaterielMapper materielMapper;

	@Override
	public Integer materieAdd(Materiel materiel) {

		return materielMapper.materieAdd(materiel);
	}

	@Override
	public int getTotal(PageBean page) {

		return materielMapper.getTotal(page);
	}

	@Override
	public List<Materiel> planList(PageBean page) {
		return materielMapper.planList(page);
	}

	@Override
	public int materieDelete(String id) {
		return materielMapper.materieDelete(id);

	}

    @Override
    public Materiel materie_selectById(Long id) {
        return materielMapper.materie_selectById(id);
    }

    @Override
    public int myModalUpdate(Materiel materiel) {
        return materielMapper.myModalUpdate(materiel);
    }

	@Override
	public int materie_import(List<Materiel> materiels) {
		return materielMapper.materie_import(materiels);
	}

	@Override
	public Long materie_supper(String s) {
		List<Long> list = materielMapper.materie_supper(s);

		if (list.size()>0) {
			return list.get(0);
		}

		return 0L;
	}

	@Override
	public int materie_selectByMaterialmodel(String materialModel) {
		return materielMapper.materie_selectByMaterialmodel(materialModel);
	}

	@Override
	public Long materie_selectByMaterialmodelMX(String stringCellValue) {
		
		return materielMapper.materie_selectByMaterialmodelMX(stringCellValue);
	}


}
